package com.dfrz.ch07;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 作者：wangmaokang
 * 日期: 2021/4/15 15:27
 * 描述:
 */
public class PatternTest {
    public static void main(String[] args) {
        String p="\\w{3,5}"; //3-10 数字，字母或者下划线
        String userName="12345678990";
//       System.out.println( userName.matches(p));

        Pattern pattern=Pattern.compile(p);
        Matcher m=pattern.matcher(userName);

        System.out.println(m.matches()); //完全匹配
        System.out.println(m.lookingAt()); //包含
//        System.out.println(m.find());
//        System.out.println(m.find());




    }
}
